$\mathit{RW}$ & {\tt SR} & SR ref & storage repository in which the VDI resides \\
$\mathit{RO}_\mathit{run}$ & {\tt VBDs} & (VBD ref) Set & list of vbds that refer to this disk \\
$\mathit{RO}_\mathit{run}$ & {\tt crash\_dumps} & (crashdump ref) Set & list of crash dumps that refer to this disk \\
-$\mathit{RW}$ & {\tt virtual\_size} & int & size of disk as presented to the guest (in multiples of sector\_size field) \\
+$\mathit{RW}$ & {\tt virtual\_size} & int & size of disk as presented to the guest (in bytes). Note that, depending on storage backend type, requested size may not be respected exactly \\
$\mathit{RO}_\mathit{run}$ & {\tt physical\_utilisation} & int & amount of physical space that the disk image is currently taking up on the storage repository (in bytes) \\
$\mathit{RO}_\mathit{ins}$ & {\tt sector\_size} & int & sector size of VDI (in bytes) \\
$\mathit{RO}_\mathit{ins}$ & {\tt type} & vdi\_type & type of the VDI \\
vdi_cfg = {
'name_label': 'API_VDI',
'name_description': '',
- 'virtual_size': 100 * 1024,
+ 'virtual_size': 100 * 1024 * 1024,
'sector_size': 1024,
'type': 'system',
'parent': '',
if not is_long:
print VDI_LIST_FORMAT % {'name_label': 'VDI Label',
'uuid' : 'UUID',
- 'virtual_size': 'Sectors',
+ 'virtual_size': 'Bytes',
'sector_size': 'Sector Size'}
for vdi in vdis:
sr = srs[0]
cfg['SR'] = sr
- size = (cfg['virtual_size'] * cfg['sector_size'])/MB
+ size = cfg['virtual_size']/MB
print 'Creating VDI of size: %dMB ..' % size,
uuid = execute(server, 'VDI.create', (session, cfg), async = async)
if async:
name_label = 'VDI 1'
name_description = ''
-virtual_size = 10 * 1024
+virtual_size = 10 * 1024 * 1024
sector_size = 1024
type = 'system'
sharable = False
image = self.images[image_uuid]
image_cfg = {
'sector_size': sector_size,
- 'virtual_size': sector_count,
+ 'virtual_size': size_bytes,
'type': vdi_struct.get('type', 'system'),
'name_label': vdi_struct.get('name_label', ''),
'name_description': vdi_struct.get('name_description', ''),